Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

Îåêßíçóå áðü ôï ìÝëïò MCP. Τελευταία δημοσίευση από το μέλος MCP στις 01-07-2011, 18:47. Υπάρχουν 15 απαντήσεις.
Σελίδα 1 από 2 (16 εγγραφές)   1 2 >
Ταξινόμηση Δημοσιεύσεων: Προηγούμενο Επόμενο
  •  27-06-2011, 14:54 66392

    ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    Καλησπέρα σε όλους...

    Φτιάχνω ένα site με το όνομα http://pc-game.gr. Χρειάζομαι όμως βοήθεια σε ένα σημείο. Θέλω στην περιγραφή του παιχνιδιού να βάλω ένα κείμενο που να λέει "πατήστε εδώ για να δείτε εικόνες του παιχνιδιού" και το "πατήστε εδώ" να έχει το σύνδεσμο.

    Για παράδειγμα παίρνουμε το προϊόν αυτό: http://pc-game.gr/game-49

    Για να γίνει αυτό που λέω θα πρέπει να υπάρχει το hyperlink της google με την κατάλληλη λέξη σε δύο σημεία του συνδέσμου όπου παρακάτω φαίνονται ως game και βέβαια θα μας βγάλει αποτελέσματα εικόνων για τη λέξη game.

    http://www.google.gr/search?hl=el&biw=1366&bih=620&gbv=2&tbm=isch&sa=1&q=game&oq=game&aq=f&aqi=g10&aql=undefined&gs_sm=s&gs_upl=240040l242004l0l6l6l0l0l0l0l266l1446l2-6l6

     

    Στην περιγραφή(product description) μέσα στο site όπως φαίνεται παρακάτω ο κώδικας είναι έτσι:

    <p>

     <a href="http://www.google.gr/search?hl=el&amp;biw=1366&amp;bih=620&amp;gbv=2&amp;tbm=isch&amp;sa=1&amp;q=game&amp;oq=game&amp;aq=f&amp;aqi=g10&amp;aql=undefined&amp;gs_sm=s&amp;gs_upl=240040l242004l0l6l6l0l0l0l0l266l1446l2-6l6" target="_blank">&pi;&alpha;&tau;ή&sigma;&tau;&epsilon; &epsilon;&delta;ώ</a></p>

    <p>

     <a href="http://www.google.gr/search?hl=el&amp;biw=1366&amp;bih=620&amp;gbv=2&amp;tbm=isch&amp;sa=1&amp;q=game&amp;oq=game&amp;aq=f&amp;aqi=g10&amp;aql=undefined&amp;gs_sm=s&amp;gs_upl=240040l242004l0l6l6l0l0l0l0l266l1446l2-6l6" target="_blank">&pi;&alpha;&tau;ή&sigma;&tau;&epsilon; &epsilon;&delta;ώ</a></p>

     

    Το πρόβλημά μου είναι το πως στη θέση της λέξης game στο κώδικα θα βάζει αυτόματα κάθε φορά τον τίτλο του προϊόντος όπως φαίνεται στη σελίδα του παραδείγματος http://pc-game.gr/game-49  πάνω πάνω.

     

    Ο τίτλος του εκάστοτε προϊόντος στο excel που γίνεται export από το site έχει την ονομασία name.

    Πραγματικά δε γνωρίζω πως θα βρώ πως ονομάζει τον τίτλο του προϊόντος και πως βέβαια θα πρέπει να το βάλω στη θέση της λέξης game.

    Χρειάζομαι πολύ τη βοήθειά σας και ευχαριστώ θερμά για την όποια παρέμβαση.

     

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


    Δημήτρης
    ΜCP, MCTS, A+, NET+
  •  29-06-2011, 21:02 66433 σε απάντηση της 66392

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    Μήπως μπορεί να μου πει κάποιος αν αυτό γίνεται ή είναι κάτι αδύνατο;


    Δημήτρης
    ΜCP, MCTS, A+, NET+
  •  30-06-2011, 09:08 66437 σε απάντηση της 66433

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    βασικα βλεπω ειναι php οχι καποια .net τεχνολογια οποτε δεν ξερω ποσα παιδια εδω μπορουν να απαντησουν,

    γενικα θα ελεγα 2 πραγματα

    1)ειναι λιγο μη εππαγελματικο να πετας τον αλλον στο google για εικονες αντι να εχεις επιλεξει εσυ 2-3 και να βλεπει ο αλλος απο τσοντες μεχρι διαφημησεις.

    2)σιγουρα καπου στο php κωδικα σου εχεις μεταβλητη τυπου string $gamename παραδειγμα που ετσι κι αλλιως εμφανιζεις λιγο παραπανω στον τιτλο οταν ανοιγει ενα παιχνιδι, τσιμπα αυτη την μεταβλητη και κανε ενα dynamic concatenate string που ειναι θα ειναι το λινκ σου.

    πολυ γρηγορα με μια αναζητησει βρηκα αυτο σαν δειγμα αν βοηθαει λιγο: 
    στο παραδειγμα αυτο η μεταβλητη $id μπαινει σφήνα στο link. αυτο θες λογικα. βρς ποια ειναι η μεταβλητη σου που εχει αυτο που θες και βαλτην καπως ετσι στο δικό σου link.
    $links .= '<a href="about.php?para='. $id .'">'. $id .'</a> ';
    goodluck

    This Business Is Binary. You are a 1 or a 0. Alive or Dead.-
  •  30-06-2011, 10:13 66438 σε απάντηση της 66437

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    Τόνους! Προτάσεις! Διαφορετικά δεν μιλάμε για "μή επαγγελματικό", μιλάμε για αντισυναδελφικό. Επίσης, καλό είναι να αποφεύγονται οι "πολύ γρήγορες αναζητήσεις" για γλώσσες που δεν γνωρίζουμε. Το πρόβλημα του MCP δεν είναι πως να κάνει  string concatenation για να φτιάξει ένα  link αλλά πως να εμφανίσει αυτό το string στην HTML. Αν μιλούσαμε για ASP.NET θα μπορούσε να γράψει απλούστατα :

    <a href="http://www.google.com/blablabla&q=<%= gameName %>blahblah</a>
    ή να χρησιμοποιήσει κάποιο control με data binding. Από τη στιγμή που μιλάμε για κατάλογο, το data binding είναι το καλύτερο.

    Χωρίς να υποστηρίζω ότι ξέρω PHP, βλέπω ότι το αντίστοιχο είναι το echo ενώ μπορείς να χρησιμοποιήσεις και την σύνταξη της ASP.NET αν θέσεις το asp_tags στο php.ini. Στο εισαγωγικό Escaping from HTML υπάρχουν παραδείγματα με <?php echo >, <%=  %>  και <?= ?>. Στη θέση σου πάντως θα κοίταζα να βρω πως δουλεύει (αν υπάρχει) το databinding στην PHP για να διευκολύνω τη δημιουργία του καταλόγου.

    Τέλος, να παρατηρήσω ότι ο τίτλος της ερώτησης δεν φαίνεται να έχει καμμία σχέση με την ίδια την ερώτηση. Το θέμα δεν έχει να κάνει με eshop αλλά πως φτιάχνεις ένα link βασισμένο σε δεδομένα που τραβάς από κάποια βάση ή άλλο κατάλογο. 

    Παναγιώτης Καναβός, Freelancer
    Twitter: http://www.twitter.com/pkanavos
  •  30-06-2011, 10:46 66439 σε απάντηση της 66438

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    1) κλασικά μετά απο μέρες που κανείς δεν διάβασε καν το προβλημα του συναδέλφου, βγηκαν οι "καλοί συνάδελφοι" με τόνους και σωστές προτάσεις να κρινουν καποιον που προσπαθησε να δωσει λυση! κλασικο πλεον του DNZ.Stick out tongue
    μπαινει κάποιος ρωταει κάτι, τον έχουν "γραμμένο" όλοι, ξαφνικά καποιος προσπαθεί να απαντησει, 
    θα πέσουν μετα όλοι να κριτικάρουν την απάντηση.
    γι αυτό χρόνο βρίσκουν για λυσεις μάλλον βαριούνται.(τα δακρυγόνα μάλλον φταίνεStick out tongue)
    θα το κάνω σύστημα, πλάκα έχει. τουλάχιστον θα βγαίνει κάποια απάντηση για τον ενδιαφερόμενο πριν πεθάνει.Big Smile

    και κλεινω το θεμα δεν εχω αλλο διαθεση να ασχοληθω.

    2)οσο για το ερωτημα του MCP απο οσο μπορεσα να καταλάβω διότι και στις προτασεις αυτες δεν βγαζεις αμεσως νοημα (αλλα δεν σχολιασαμε αυτο)
    είναι απλό με το echo να προσθεσει στο παραπανω παραδειγμα πριν κλείσει το tag </a> ξανα την μεταβλητη που θελει.

    3)θα συμφωνήσω μονο στο οτι οι γρηγορες αναζητήσεις πρεπει να αποφεύγονται(είπε κάποιος δεν γνωρίζουμε την γλώσσα? όχι. ούτε το αντίθετο), αλλα στην περίπτωση αυτη ειναι πολυ κοντα στο τελικο αποτέλεσμα που μάλλον θελει να κάνει.


    This Business Is Binary. You are a 1 or a 0. Alive or Dead.-
  •  30-06-2011, 11:43 66440 σε απάντηση της 66439

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    Johnny, όπως έχεις διαπιστώσει κι εσύ, μία ερώτηση με λάθος τίτλο και κακή διατύπωση δεν παίρνει απάντηση. Από την άλλη, μία απάντηση που οδηγεί σε λάθος κατεύθυνση είναι χειρότερη από το καθόλου. Αν δεν έχεις καταλάβει την ερώτηση, καλύτερα μην απαντάς με ότι τύχει γιατί κατά κανόνα θα είναι λάθος.

    Όσο για το κλασσικό DNZ ... δεν έχεις άδικο. Όταν βρούμε μία παραπλανητική απάντηση οι "κλασσικοί" θα επέμβουμε. Όταν βρούμε μία κακογραμμένη ερώτηση θα το πούμε. Καλύτερα να χαλαστεί ο άλλος, παρά να πάθει ζημιά αυτός ή η εταιρεία του επειδή κάποιος του έδωσε κακή συμβουλή. Και όταν υπάρχει ο σωστός και ο λάθος τρόπος, ή μάλλον ο επαγγελματικός και ο ερασιτεχνικός τρόπος, θα τον πούμε και αυτόν.

    Παναγιώτης Καναβός, Freelancer
    Twitter: http://www.twitter.com/pkanavos
  •  30-06-2011, 11:59 66441 σε απάντηση της 66440

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    you get what you give
    agree on that.

    confused question = confused answer Confused*
    confused answer = "critic" responses Stick out tongue
    "critic" responses = "flaming" post Angry
    flaming post = more clear original question Surprise
    more clear original question = better answers Big Smile





    *we are an unofficial user forum not MSDN to take responsibility for any kind of response and damage caused by this.Stick out tongue

    This Business Is Binary. You are a 1 or a 0. Alive or Dead.-
  •  30-06-2011, 19:35 66445 σε απάντηση της 66441

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    Ευχαριστώ που ασχοληθήκατε με το πρόβλημά μου. Έχω βοηθήσει και εγώ πολλούς στο αδελφικό site autoexec.gr και χαίρομαι όταν γίνεται το ίδιο και σε μένα.

    Δεν είμαι προγραμματιστής. Το eshop(μου) το φτιάχνω με "έτοιμο πρόγραμμα". Όσον αφορά τις εικόνες τις google απ'ότι φαίνεται και καθώς δεν υπάρχει χρόνος, αναγκαστικά θα πρέπει να γίνει έτσι. Οι πελάτες μέσω τις google βρίσκουν εικόνες για το παιχνίδι. Εννοείται ότι θα γράψω ότι ίσως να μη βγει η σωστή εικόνα αλλά από την άλλη οι δοκιμές που έκανα δείχνουν ότι πάντα βγαίνουν σωστές εικόνες.

    Ο τίτλος είναι όντως πολύ γενικός.

    Μπορείτε να μου πείτε πως πρέπει να γραφτεί σύμφωνα με αυτά που σκεφτήκατε πάνω στο παράδειγμά μου για να γίνει η δουλειά έστω και αν δεν είναι σωστό; Γιατί από τα άλλα που μου λέτε δεν καταλαβαίνω και πολλά ως IT... Big Smile


    Δημήτρης
    ΜCP, MCTS, A+, NET+
  •  30-06-2011, 22:51 66447 σε απάντηση της 66445

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    <h1>GAME</h1>

    title="GAME" alt="GAME" id="image" style="margin-bottom: 3px;" /></a><br />

     

     Βρήκα αυτά τα δύο σημεία όπου υπάρχει η λέξη που θέλω να μπει αυτόματα στο Link της Google. Δεν ξέρω αν βοηθάει αυτό.

     

     


    Δημήτρης
    ΜCP, MCTS, A+, NET+
  •  01-07-2011, 00:17 66448 σε απάντηση της 66447

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    στον php κωδικα της σελιδας (αλλα αμα ειναι μηχανη ετοιμη πρεπει να ψαξεις αλλου σε κανα αρχειο template ktl πανικος ετσι στα κουτουρου να σου πω)
    πρεπει λοιπον να ψαξεις για μεταβλητη που εχει το ονομα που θελεις!
    η μεταβλητες στην php ειναι καπως ετσι: $myVariable

    ψαξε για κατι που να εχει ονομα που να δηλωνει οτι ειναι ο τιτλος του παιχνιδιου-προιοντος εκει μεσα, αυτη την μεταβλητη σου λεω παραπανω πως να την "κολ'ησεις"

    λυπαμε αλλα ειναι σαν να λεω δεν ξερω απο αμαξια μηχανικά πλα το οδηγω, βοηθηστε με να αλλαξω φλατζες, πιστονια και ελατηρια στο αμαξι μου μεσω ιντερνετ!
    σορρυ αδυνατον! Sad

    αν ειχαμε την σελιδα και των κωδικα της php ισως κατι να γινοταν....ίσως
    το παραπανω κομματι που γραφεις ειναι απλα ενας html κωδικας και τιποτα χρησιμο, αυτο δεν ξερω απο του το πηρες αλλα πολυ πηθανο να ειναι το αποτελεσμα μετα την εκτελεση της .php σελιδας οταν γινεται HTML.

    This Business Is Binary. You are a 1 or a 0. Alive or Dead.-
  •  01-07-2011, 01:00 66449 σε απάντηση της 66448

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    Δίκιο έχεις και το σκέφτηκα. Αυτό είναι όντως το αποτέλεσμα(προέλευση) και όχι από αρχείο τoυ site.

    Παρακάτω αντέγραψα το αρχείο php για τα προϊόντα. Το product.php. Λογικά αυτό΄είναι που χρειαζόμαστε. Δε βρήκα κάτι άλλο. Αν δε βρεις Johny τώρα κάτι ή κάποιος άλλος τότε μάλλον ψάχνω ψύλλους στ' άχυρα.

     

    <?php 
    class ControllerProductProduct extends Controller {
     private $error = array();
     
     public function index() {
      $this->language->load('product/product');
        
      $this->document->breadcrumbs = array();

      $this->document->breadcrumbs[] = array(
       'href'      => HTTP_SERVER . 'index.php?route=common/home',
       'text'      => $this->language->get('text_home'),
       'separator' => FALSE
      );
      
      $this->load->model('tool/seo_url');
      
      $this->load->model('catalog/category'); 
      
      if (isset($this->request->get['path'])) {
       $path = '';
        
       foreach (explode('_', $this->request->get['path']) as $path_id) {
        $category_info = $this->model_catalog_category->getCategory($path_id);
        
        if (!$path) {
         $path = $path_id;
        } else {
         $path .= '_' . $path_id;
        }
        
        if ($category_info) {
         $this->document->breadcrumbs[] = array(
          'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $path),
          'text'      => $category_info['name'],
          'separator' => $this->language->get('text_separator')
         );
        }
       }
      }
      
      $this->load->model('catalog/manufacturer'); 
      
      if (isset($this->request->get['manufacturer_id'])) {
       $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);

       if ($manufacturer_info) { 
        $this->document->breadcrumbs[] = array(
         'href'     => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $this->request->get['manufacturer_id']),
         'text'     => $manufacturer_info['name'],
         'separator' => $this->language->get('text_separator')
        );
       }
      }
      
      if (isset($this->request->get['keyword'])) {
       $url = '';

       if (isset($this->request->get['category_id'])) {
        $url .= '&category_id=' . $this->request->get['category_id'];
       } 
       
       if (isset($this->request->get['description'])) {
        $url .= '&description=' . $this->request->get['description'];
       }
       
       $this->document->breadcrumbs[] = array(
        'href'      => HTTP_SERVER . 'index.php?route=product/search&keyword=' . $this->request->get['keyword'] . $url,
        'text'      => $this->language->get('text_search'),
        'separator' => $this->language->get('text_separator')
       ); 
      }
      
      $this->load->model('catalog/product');
      
      if (isset($this->request->get['product_id'])) {
       $product_id = $this->request->get['product_id'];
      } else {
       $product_id = 0;
      }
      
      $product_info = $this->model_catalog_product->getProduct($product_id);
      
      if ($product_info) {
       $url = '';
       
       if (isset($this->request->get['path'])) {
        $url .= '&path=' . $this->request->get['path'];
       }
       
       if (isset($this->request->get['manufacturer_id'])) {
        $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
       }   

       if (isset($this->request->get['keyword'])) {
        $url .= '&keyword=' . $this->request->get['keyword'];
       }   

       if (isset($this->request->get['category_id'])) {
        $url .= '&category_id=' . $this->request->get['category_id'];
       }
        
       if (isset($this->request->get['description'])) {
        $url .= '&description=' . $this->request->get['description'];
       }    
             
       $this->document->breadcrumbs[] = array(
        'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product' . $url . '&product_id=' . $this->request->get['product_id']),
        'text'      => $product_info['name'],
        'separator' => $this->language->get('text_separator')
       );   
       
       $this->document->title = $product_info['name'];
       
       $this->document->keywords = $product_info['meta_keywords'];
       
       $this->document->description = $product_info['meta_description'];

       $this->document->links = array();
     
       $this->document->links[] = array(
        'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $this->request->get['product_id']),
        'rel'  => 'canonical'
       );

       $this->data['heading_title'] = $product_info['name'];

       $this->data['text_enlarge'] = $this->language->get('text_enlarge');
       $this->data['text_discount'] = $this->language->get('text_discount');
       $this->data['text_options'] = $this->language->get('text_options');
       $this->data['text_price'] = $this->language->get('text_price');
       $this->data['text_availability'] = $this->language->get('text_availability');
       $this->data['text_model'] = $this->language->get('text_model');
       $this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
       $this->data['text_order_quantity'] = $this->language->get('text_order_quantity');
       $this->data['text_price_per_item'] = $this->language->get('text_price_per_item');
       $this->data['text_qty'] = $this->language->get('text_qty');
       $this->data['text_write'] = $this->language->get('text_write');
       $this->data['text_average'] = $this->language->get('text_average');
       $this->data['text_no_rating'] = $this->language->get('text_no_rating');
       $this->data['text_note'] = $this->language->get('text_note');
       $this->data['text_no_images'] = $this->language->get('text_no_images');
       $this->data['text_no_related'] = $this->language->get('text_no_related');
       $this->data['text_wait'] = $this->language->get('text_wait');
       $this->data['text_tags'] = $this->language->get('text_tags');
       $this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']);

       $this->data['entry_name'] = $this->language->get('entry_name');
       $this->data['entry_review'] = $this->language->get('entry_review');
       $this->data['entry_rating'] = $this->language->get('entry_rating');
       $this->data['entry_good'] = $this->language->get('entry_good');
       $this->data['entry_bad'] = $this->language->get('entry_bad');
       $this->data['entry_captcha'] = $this->language->get('entry_captcha');

       $this->data['button_continue'] = $this->language->get('button_continue');
       
       $this->load->model('catalog/review');

       $this->data['tab_description'] = $this->language->get('tab_description');
       $this->data['tab_image'] = $this->language->get('tab_image');
       $this->data['tab_review'] = sprintf($this->language->get('tab_review'), $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']));
       $this->data['tab_related'] = $this->language->get('tab_related');
       
       if ($this->config->get('config_review')) {
        $average = $this->model_catalog_review->getAverageRating($this->request->get['product_id']); 
       } else {
        $average = false;
       }
       
       $this->data['review_status'] = $this->config->get('config_review');
       
       $this->data['text_stars'] = sprintf($this->language->get('text_stars'), $average);
       
       $this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');

       $this->data['action'] = HTTP_SERVER . 'index.php?route=checkout/cart';
       
       $this->data['redirect'] = HTTP_SERVER . 'index.php?route=product/product' . $url . '&product_id=' . $this->request->get['product_id'];

       $this->load->model('tool/image');

       if ($product_info['image']) {
        $image = $product_info['image'];
       } else {
        $image = 'no_image.jpg';
       } 
         
       $this->data['popup'] = $this->model_tool_image->resize($image, $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
       $this->data['thumb'] = $this->model_tool_image->resize($image, $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));

       $this->data['product_info'] = $product_info;
       
       $discount = $this->model_catalog_product->getProductDiscount($this->request->get['product_id']);
       
       if ($discount) {
        $this->data['price'] = $this->currency->format($this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax')));
        
        $this->data['special'] = FALSE;
       } else {
        $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
       
        $special = $this->model_catalog_product->getProductSpecial($this->request->get['product_id']);
       
        if ($special) {
         $this->data['special'] = $this->currency->format($this->tax->calculate($special, $product_info['tax_class_id'], $this->config->get('config_tax')));
        } else {
         $this->data['special'] = FALSE;
        }
       }
       
       $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
       
       $this->data['discounts'] = array();
       
       foreach ($discounts as $discount) {
        $this->data['discounts'][] = array(
         'quantity' => $discount['quantity'],
         'price'    => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')))
        );
       }
       
       if ($product_info['quantity'] <= 0) {
        $this->data['stock'] = $product_info['stock'];
       } else {
        if ($this->config->get('config_stock_display')) {
         $this->data['stock'] = $product_info['quantity'];
        } else {
         $this->data['stock'] = $this->language->get('text_instock');
        }
       }
       
       if ($product_info['minimum']) {
        $this->data['minimum'] = $product_info['minimum'];
       } else {
        $this->data['minimum'] = 1;
       }
       
       $this->data['model'] = $product_info['model'];
       $this->data['manufacturer'] = $product_info['manufacturer'];
       $this->data['manufacturers'] = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $product_info['manufacturer_id']);
       $this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
       $this->data['product_id'] = $this->request->get['product_id'];
       $this->data['average'] = $average;
       
       $this->data['options'] = array();
       
       $options = $this->model_catalog_product->getProductOptions($this->request->get['product_id']);
       
       foreach ($options as $option) {
        $option_value_data = array();
        
        foreach ($option['option_value'] as $option_value) {
         $option_value_data[] = array(
          'option_value_id' => $option_value['product_option_value_id'],
          'name'            => $option_value['name'],
          'price'           => (float)$option_value['price'] ? $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) : FALSE,
          'prefix'          => $option_value['prefix']
         );
        }
        
        $this->data['options'][] = array(
         'option_id'    => $option['product_option_id'],
         'name'         => $option['name'],
         'option_value' => $option_value_data
        );
       }
       
       $this->data['images'] = array();
       
       $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
       
       foreach ($results as $result) {
        $this->data['images'][] = array(
         'popup' => $this->model_tool_image->resize($result['image'] , $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
         'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
        );
       }

       $this->data['products'] = array();
       
       $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
       
       foreach ($results as $result) {
        if ($result['image']) {
         $image = $result['image'];
        } else {
         $image = 'no_image.jpg';
        }
       
        if ($this->config->get('config_review')) {
         $rating = $this->model_catalog_review->getAverageRating($result['product_id']); 
        } else {
         $rating = false;
        }
        
        $special = FALSE;
        
        $discount = $this->model_catalog_product->getProductDiscount($result['product_id']);
       
        if ($discount) {
         $price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax')));
        } else {
         $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
         
         $special = $this->model_catalog_product->getProductSpecial($result['product_id']);
        
         if ($special) {
          $special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax')));
         }
        }
       
        $options = $this->model_catalog_product->getProductOptions($result['product_id']);
       
        if ($options) {
         $add = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']);
        } else {
         $add = HTTPS_SERVER . 'index.php?route=checkout/cart&product_id=' . $result['product_id'];
        }
       
        $this->data['products'][] = array(
         'product_id'    => $result['product_id'],
         'name'      => $result['name'],
         'model'     => $result['model'],
         'rating'    => $rating,
         'stars'     => sprintf($this->language->get('text_stars'), $rating),
         'price'     => $price,
         'options'    => $options,
         'special'   => $special,
         'image'     => $this->model_tool_image->resize($image, 38, 38),
         'thumb'     => $this->model_tool_image->resize($image, $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height')),
         'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']),
         'add'      => $add
        );
       }

       if (!$this->config->get('config_customer_price')) {
        $this->data['display_price'] = TRUE;
       } elseif ($this->customer->isLogged()) {
        $this->data['display_price'] = TRUE;

       } else {
        $this->data['display_price'] = FALSE;
       }
       
       $this->model_catalog_product->updateViewed($this->request->get['product_id']);
       
       $this->data['tags'] = array();
         
       $results = $this->model_catalog_product->getProductTags($this->request->get['product_id']);
       
       foreach ($results as $result) {
        if ($result['tag']) {
         $this->data['tags'][] = array(
          'tag' => $result['tag'],
          'href' => HTTP_SERVER . 'index.php?route=product/search&keyword=' . $result['tag']
         );
        }
       }
       
       if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
        $this->template = $this->config->get('config_template') . '/template/product/product.tpl';
       } else {
        $this->template = 'default/template/product/product.tpl';
       }
       
       $this->children = array(
        'common/column_right',
        'common/column_left',
        'common/footer',
        'common/header'
       );
       
       $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
      } else {
       $url = '';
       
       if (isset($this->request->get['path'])) {
        $url .= '&path=' . $this->request->get['path'];
       }
       
       if (isset($this->request->get['manufacturer_id'])) {
        $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
       }   

       if (isset($this->request->get['keyword'])) {
        $url .= '&keyword=' . $this->request->get['keyword'];
       }   

       if (isset($this->request->get['category_id'])) {
        $url .= '&category_id=' . $this->request->get['category_id'];
       }
        
       if (isset($this->request->get['description'])) {
        $url .= '&description=' . $this->request->get['description'];
       }  
         
            $this->document->breadcrumbs[] = array(
              'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product' . $url . '&product_id=' . $product_id),
              'text'      => $this->language->get('text_error'),
              'separator' => $this->language->get('text_separator')
            );   
      
            $this->document->title = $this->language->get('text_error');

            $this->data['heading_title'] = $this->language->get('text_error');

            $this->data['text_error'] = $this->language->get('text_error');

            $this->data['button_continue'] = $this->language->get('button_continue');

            $this->data['continue'] = HTTP_SERVER . 'index.php?route=common/home';
      
       if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
        $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
       } else {
        $this->template = 'default/template/error/not_found.tpl';
       }
       
       $this->children = array(
        'common/column_right',
        'common/column_left',
        'common/footer',
        'common/header'
       );
       
       $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
         }
       }
     
     public function review() {
         $this->language->load('product/product');
      
      $this->load->model('catalog/review');

      $this->data['text_no_reviews'] = $this->language->get('text_no_reviews');

      if (isset($this->request->get['page'])) {
       $page = $this->request->get['page'];
      } else {
       $page = 1;
      } 
      
      $this->data['reviews'] = array();
       
      $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
            
      foreach ($results as $result) {
             $this->data['reviews'][] = array(
              'author'     => $result['author'],
        'rating'     => $result['rating'],
        'text'       => strip_tags($result['text']),
              'stars'      => sprintf($this->language->get('text_stars'), $result['rating']),
              'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))
             );
           }   
      
      $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
       
      $pagination = new Pagination();
      $pagination->total = $review_total;
      $pagination->page = $page;
      $pagination->limit = 5;
      $pagination->text = $this->language->get('text_pagination');
      $pagination->url = HTTP_SERVER . 'index.php?route=product/product/review&product_id=' . $this->request->get['product_id'] . '&page={page}';
       
      $this->data['pagination'] = $pagination->render();

      if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) {
       $this->template = $this->config->get('config_template') . '/template/product/review.tpl';
      } else {
       $this->template = 'default/template/product/review.tpl';
      }
      
      $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
     }
     
     public function write() {
      $this->language->load('product/product');
      
      $this->load->model('catalog/review');
      
      $json = array();
      
      if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
       $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);
       
       $json['success'] = $this->language->get('text_success');
      } else {
       $json['error'] = $this->error['message'];
      } 
      
      $this->load->library('json');
      
      $this->response->setOutput(Json::encode($json));
     }
     
     public function captcha() {
      $this->load->library('captcha');
      
      $captcha = new Captcha();
      
      $this->session->data['captcha'] = $captcha->getCode();
      
      $captcha->showImage();
     }
     
     private function validate() {
      if ((strlen(utf8_decode($this->request->post['name'])) < 3) || (strlen(utf8_decode($this->request->post['name'])) > 25)) {
       $this->error['message'] = $this->language->get('error_name');
      }
      
      if ((strlen(utf8_decode($this->request->post['text'])) < 25) || (strlen(utf8_decode($this->request->post['text'])) > 1000)) {
       $this->error['message'] = $this->language->get('error_text');
      }

      if (!$this->request->post['rating']) {
       $this->error['message'] = $this->language->get('error_rating');
      }

      if (!isset($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
       $this->error['message'] = $this->language->get('error_captcha');
      }

      if (!$this->error) {
       return TRUE;
      } else {
       return FALSE;
      } 
     }
    }
    ?><?php 
    class ControllerProductProduct extends Controller {
     private $error = array();
     
     public function index() {
      $this->language->load('product/product');
        
      $this->document->breadcrumbs = array();

      $this->document->breadcrumbs[] = array(
       'href'      => HTTP_SERVER . 'index.php?route=common/home',
       'text'      => $this->language->get('text_home'),
       'separator' => FALSE
      );
      
      $this->load->model('tool/seo_url');
      
      $this->load->model('catalog/category'); 
      
      if (isset($this->request->get['path'])) {
       $path = '';
        
       foreach (explode('_', $this->request->get['path']) as $path_id) {
        $category_info = $this->model_catalog_category->getCategory($path_id);
        
        if (!$path) {
         $path = $path_id;
        } else {
         $path .= '_' . $path_id;
        }
        
        if ($category_info) {
         $this->document->breadcrumbs[] = array(
          'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $path),
          'text'      => $category_info['name'],
          'separator' => $this->language->get('text_separator')
         );
        }
       }
      }
      
      $this->load->model('catalog/manufacturer'); 
      
      if (isset($this->request->get['manufacturer_id'])) {
       $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);

       if ($manufacturer_info) { 
        $this->document->breadcrumbs[] = array(
         'href'     => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $this->request->get['manufacturer_id']),
         'text'     => $manufacturer_info['name'],
         'separator' => $this->language->get('text_separator')
        );
       }
      }
      
      if (isset($this->request->get['keyword'])) {
       $url = '';

       if (isset($this->request->get['category_id'])) {
        $url .= '&category_id=' . $this->request->get['category_id'];
       } 
       
       if (isset($this->request->get['description'])) {
        $url .= '&description=' . $this->request->get['description'];
       }
       
       $this->document->breadcrumbs[] = array(
        'href'      => HTTP_SERVER . 'index.php?route=product/search&keyword=' . $this->request->get['keyword'] . $url,
        'text'      => $this->language->get('text_search'),
        'separator' => $this->language->get('text_separator')
       ); 
      }
      
      $this->load->model('catalog/product');
      
      if (isset($this->request->get['product_id'])) {
       $product_id = $this->request->get['product_id'];
      } else {
       $product_id = 0;
      }
      
      $product_info = $this->model_catalog_product->getProduct($product_id);
      
      if ($product_info) {
       $url = '';
       
       if (isset($this->request->get['path'])) {
        $url .= '&path=' . $this->request->get['path'];
       }
       
       if (isset($this->request->get['manufacturer_id'])) {
        $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
       }   

       if (isset($this->request->get['keyword'])) {
        $url .= '&keyword=' . $this->request->get['keyword'];
       }   

       if (isset($this->request->get['category_id'])) {
        $url .= '&category_id=' . $this->request->get['category_id'];
       }
        
       if (isset($this->request->get['description'])) {
        $url .= '&description=' . $this->request->get['description'];
       }    
             
       $this->document->breadcrumbs[] = array(
        'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product' . $url . '&product_id=' . $this->request->get['product_id']),
        'text'      => $product_info['name'],
        'separator' => $this->language->get('text_separator')
       );   
       
       $this->document->title = $product_info['name'];
       
       $this->document->keywords = $product_info['meta_keywords'];
       
       $this->document->description = $product_info['meta_description'];

       $this->document->links = array();
     
       $this->document->links[] = array(
        'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $this->request->get['product_id']),
        'rel'  => 'canonical'
       );

       $this->data['heading_title'] = $product_info['name'];

       $this->data['text_enlarge'] = $this->language->get('text_enlarge');
       $this->data['text_discount'] = $this->language->get('text_discount');
       $this->data['text_options'] = $this->language->get('text_options');
       $this->data['text_price'] = $this->language->get('text_price');
       $this->data['text_availability'] = $this->language->get('text_availability');
       $this->data['text_model'] = $this->language->get('text_model');
       $this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
       $this->data['text_order_quantity'] = $this->language->get('text_order_quantity');
       $this->data['text_price_per_item'] = $this->language->get('text_price_per_item');
       $this->data['text_qty'] = $this->language->get('text_qty');
       $this->data['text_write'] = $this->language->get('text_write');
       $this->data['text_average'] = $this->language->get('text_average');
       $this->data['text_no_rating'] = $this->language->get('text_no_rating');
       $this->data['text_note'] = $this->language->get('text_note');
       $this->data['text_no_images'] = $this->language->get('text_no_images');
       $this->data['text_no_related'] = $this->language->get('text_no_related');
       $this->data['text_wait'] = $this->language->get('text_wait');
       $this->data['text_tags'] = $this->language->get('text_tags');
       $this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']);

       $this->data['entry_name'] = $this->language->get('entry_name');
       $this->data['entry_review'] = $this->language->get('entry_review');
       $this->data['entry_rating'] = $this->language->get('entry_rating');
       $this->data['entry_good'] = $this->language->get('entry_good');
       $this->data['entry_bad'] = $this->language->get('entry_bad');
       $this->data['entry_captcha'] = $this->language->get('entry_captcha');

       $this->data['button_continue'] = $this->language->get('button_continue');
       
       $this->load->model('catalog/review');

       $this->data['tab_description'] = $this->language->get('tab_description');
       $this->data['tab_image'] = $this->language->get('tab_image');
       $this->data['tab_review'] = sprintf($this->language->get('tab_review'), $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']));
       $this->data['tab_related'] = $this->language->get('tab_related');
       
       if ($this->config->get('config_review')) {
        $average = $this->model_catalog_review->getAverageRating($this->request->get['product_id']); 
       } else {
        $average = false;
       }
       
       $this->data['review_status'] = $this->config->get('config_review');
       
       $this->data['text_stars'] = sprintf($this->language->get('text_stars'), $average);
       
       $this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');

       $this->data['action'] = HTTP_SERVER . 'index.php?route=checkout/cart';
       
       $this->data['redirect'] = HTTP_SERVER . 'index.php?route=product/product' . $url . '&product_id=' . $this->request->get['product_id'];

       $this->load->model('tool/image');

       if ($product_info['image']) {
        $image = $product_info['image'];
       } else {
        $image = 'no_image.jpg';
       } 
         
       $this->data['popup'] = $this->model_tool_image->resize($image, $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
       $this->data['thumb'] = $this->model_tool_image->resize($image, $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));

       $this->data['product_info'] = $product_info;
       
       $discount = $this->model_catalog_product->getProductDiscount($this->request->get['product_id']);
       
       if ($discount) {
        $this->data['price'] = $this->currency->format($this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax')));
        
        $this->data['special'] = FALSE;
       } else {
        $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
       
        $special = $this->model_catalog_product->getProductSpecial($this->request->get['product_id']);
       
        if ($special) {
         $this->data['special'] = $this->currency->format($this->tax->calculate($special, $product_info['tax_class_id'], $this->config->get('config_tax')));
        } else {
         $this->data['special'] = FALSE;
        }
       }
       
       $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
       
       $this->data['discounts'] = array();
       
       foreach ($discounts as $discount) {
        $this->data['discounts'][] = array(
         'quantity' => $discount['quantity'],
         'price'    => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')))
        );
       }
       
       if ($product_info['quantity'] <= 0) {
        $this->data['stock'] = $product_info['stock'];
       } else {
        if ($this->config->get('config_stock_display')) {
         $this->data['stock'] = $product_info['quantity'];
        } else {
         $this->data['stock'] = $this->language->get('text_instock');
        }
       }
       
       if ($product_info['minimum']) {
        $this->data['minimum'] = $product_info['minimum'];
       } else {
        $this->data['minimum'] = 1;
       }
       
       $this->data['model'] = $product_info['model'];
       $this->data['manufacturer'] = $product_info['manufacturer'];
       $this->data['manufacturers'] = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $product_info['manufacturer_id']);
       $this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
       $this->data['product_id'] = $this->request->get['product_id'];
       $this->data['average'] = $average;
       
       $this->data['options'] = array();
       
       $options = $this->model_catalog_product->getProductOptions($this->request->get['product_id']);
       
       foreach ($options as $option) {
        $option_value_data = array();
        
        foreach ($option['option_value'] as $option_value) {
         $option_value_data[] = array(
          'option_value_id' => $option_value['product_option_value_id'],
          'name'            => $option_value['name'],
          'price'           => (float)$option_value['price'] ? $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) : FALSE,
          'prefix'          => $option_value['prefix']
         );
        }
        
        $this->data['options'][] = array(
         'option_id'    => $option['product_option_id'],
         'name'         => $option['name'],
         'option_value' => $option_value_data
        );
       }
       
       $this->data['images'] = array();
       
       $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
       
       foreach ($results as $result) {
        $this->data['images'][] = array(
         'popup' => $this->model_tool_image->resize($result['image'] , $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
         'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
        );
       }

       $this->data['products'] = array();
       
       $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
       
       foreach ($results as $result) {
        if ($result['image']) {
         $image = $result['image'];
        } else {
         $image = 'no_image.jpg';
        }
       
        if ($this->config->get('config_review')) {
         $rating = $this->model_catalog_review->getAverageRating($result['product_id']); 
        } else {
         $rating = false;
        }
        
        $special = FALSE;
        
        $discount = $this->model_catalog_product->getProductDiscount($result['product_id']);
       
        if ($discount) {
         $price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax')));
        } else {
         $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
         
         $special = $this->model_catalog_product->getProductSpecial($result['product_id']);
        
         if ($special) {
          $special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax')));
         }
        }
       
        $options = $this->model_catalog_product->getProductOptions($result['product_id']);
       
        if ($options) {
         $add = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']);
        } else {
         $add = HTTPS_SERVER . 'index.php?route=checkout/cart&product_id=' . $result['product_id'];
        }
       
        $this->data['products'][] = array(
         'product_id'    => $result['product_id'],
         'name'      => $result['name'],
         'model'     => $result['model'],
         'rating'    => $rating,
         'stars'     => sprintf($this->language->get('text_stars'), $rating),
         'price'     => $price,
         'options'    => $options,
         'special'   => $special,
         'image'     => $this->model_tool_image->resize($image, 38, 38),
         'thumb'     => $this->model_tool_image->resize($image, $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height')),
         'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']),
         'add'      => $add
        );
       }

       if (!$this->config->get('config_customer_price')) {
        $this->data['display_price'] = TRUE;
       } elseif ($this->customer->isLogged()) {
        $this->data['display_price'] = TRUE;

       } else {
        $this->data['display_price'] = FALSE;
       }
       
       $this->model_catalog_product->updateViewed($this->request->get['product_id']);
       
       $this->data['tags'] = array();
         
       $results = $this->model_catalog_product->getProductTags($this->request->get['product_id']);
       
       foreach ($results as $result) {
        if ($result['tag']) {
         $this->data['tags'][] = array(
          'tag' => $result['tag'],
          'href' => HTTP_SERVER . 'index.php?route=product/search&keyword=' . $result['tag']
         );
        }
       }
       
       if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
        $this->template = $this->config->get('config_template') . '/template/product/product.tpl';
       } else {
        $this->template = 'default/template/product/product.tpl';
       }
       
       $this->children = array(
        'common/column_right',
        'common/column_left',
        'common/footer',
        'common/header'
       );
       
       $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
      } else {
       $url = '';
       
       if (isset($this->request->get['path'])) {
        $url .= '&path=' . $this->request->get['path'];
       }
       
       if (isset($this->request->get['manufacturer_id'])) {
        $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
       }   

       if (isset($this->request->get['keyword'])) {
        $url .= '&keyword=' . $this->request->get['keyword'];
       }   

       if (isset($this->request->get['category_id'])) {
        $url .= '&category_id=' . $this->request->get['category_id'];
       }
        
       if (isset($this->request->get['description'])) {
        $url .= '&description=' . $this->request->get['description'];
       }  
         
            $this->document->breadcrumbs[] = array(
              'href'      => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product' . $url . '&product_id=' . $product_id),
              'text'      => $this->language->get('text_error'),
              'separator' => $this->language->get('text_separator')
            );   
      
            $this->document->title = $this->language->get('text_error');

            $this->data['heading_title'] = $this->language->get('text_error');

            $this->data['text_error'] = $this->language->get('text_error');

            $this->data['button_continue'] = $this->language->get('button_continue');

            $this->data['continue'] = HTTP_SERVER . 'index.php?route=common/home';
      
       if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
        $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
       } else {
        $this->template = 'default/template/error/not_found.tpl';
       }
       
       $this->children = array(
        'common/column_right',
        'common/column_left',
        'common/footer',
        'common/header'
       );
       
       $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
         }
       }
     
     public function review() {
         $this->language->load('product/product');
      
      $this->load->model('catalog/review');

      $this->data['text_no_reviews'] = $this->language->get('text_no_reviews');

      if (isset($this->request->get['page'])) {
       $page = $this->request->get['page'];
      } else {
       $page = 1;
      } 
      
      $this->data['reviews'] = array();
       
      $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
            
      foreach ($results as $result) {
             $this->data['reviews'][] = array(
              'author'     => $result['author'],
        'rating'     => $result['rating'],
        'text'       => strip_tags($result['text']),
              'stars'      => sprintf($this->language->get('text_stars'), $result['rating']),
              'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))
             );
           }   
      
      $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
       
      $pagination = new Pagination();
      $pagination->total = $review_total;
      $pagination->page = $page;
      $pagination->limit = 5;
      $pagination->text = $this->language->get('text_pagination');
      $pagination->url = HTTP_SERVER . 'index.php?route=product/product/review&product_id=' . $this->request->get['product_id'] . '&page={page}';
       
      $this->data['pagination'] = $pagination->render();

      if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) {
       $this->template = $this->config->get('config_template') . '/template/product/review.tpl';
      } else {
       $this->template = 'default/template/product/review.tpl';
      }
      
      $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
     }
     
     public function write() {
      $this->language->load('product/product');
      
      $this->load->model('catalog/review');
      
      $json = array();
      
      if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
       $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);
       
       $json['success'] = $this->language->get('text_success');
      } else {
       $json['error'] = $this->error['message'];
      } 
      
      $this->load->library('json');
      
      $this->response->setOutput(Json::encode($json));
     }
     
     public function captcha() {
      $this->load->library('captcha');
      
      $captcha = new Captcha();
      
      $this->session->data['captcha'] = $captcha->getCode();
      
      $captcha->showImage();
     }
     
     private function validate() {
      if ((strlen(utf8_decode($this->request->post['name'])) < 3) || (strlen(utf8_decode($this->request->post['name'])) > 25)) {
       $this->error['message'] = $this->language->get('error_name');
      }
      
      if ((strlen(utf8_decode($this->request->post['text'])) < 25) || (strlen(utf8_decode($this->request->post['text'])) > 1000)) {
       $this->error['message'] = $this->language->get('error_text');
      }

      if (!$this->request->post['rating']) {
       $this->error['message'] = $this->language->get('error_rating');
      }

      if (!isset($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
       $this->error['message'] = $this->language->get('error_captcha');
      }

      if (!$this->error) {
       return TRUE;
      } else {
       return FALSE;
      } 
     }
    }
    ?>


    Δημήτρης
    ΜCP, MCTS, A+, NET+
  •  01-07-2011, 09:56 66450 σε απάντηση της 66449

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    σερνεται το DNZ αμα ποσταρεις μεγαλο κειμενο!
    και μετα κανει double post.Sad



    This Business Is Binary. You are a 1 or a 0. Alive or Dead.-
  •  01-07-2011, 09:59 66451 σε απάντηση της 66449

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    λοιπον εχω καλα νεα και κακα νεα

    αρχιζω απο τα κακα,
    -δεν παιζει να βρω χρονο να δω τωρα ολο αυτο το κατεβατο αλλα λιγο που το ειδα ναι νομιζω οτι ειναι 80% η σελιδα που θελουμε, αλλα κραταω σοβαρη επιφυλαξη, αν βρω χρονο το σ/κ μπορει να το μελετησω.

    -διαβαζοντας ξανα και ξανα το πρωτο ερωτημα και κοιτοντας την σελιδα σου, βλεπω οτι αυτου που θες με τον τροπο που το κανεις κατα την γνωμη μου και απο οσο νομιζω καταλαβα, δεν προκειτε να γινει ποτε! "ποτε" μεγαλη λεξη οκ, να διορθωσω, δεν γινεται χωρις να ανοιξεις τεραστιο κενό ασφαλείας στην σελίδα σου!

    allow me to explain στην απλη χωρις ορολογίες και θεωρίες....

    τωρα αν καταλαβα σωστα, το "πατηστε εδω" το γραφεις εσυ μεσα σε ενα textbox πεδιο την ωρα που περνας το προιον! σωστα?
    το οτι το εκανες να ειναι το κειμενο και link ειναι καθαρα γιατι το site και το πεδιο σου επιτρεπουν να κανεις hyperlinks μεσα στα "σχολια αυτα", σωστα?

    εσυ αυτο που θες να κανεις για να καταλαβεις ειναι ενας συνδιασμος plain text + html + php, ενω τα 2 πρωτα ειναι "ακακα" σου επιτρεπει να τα κανεις αλλα κανενα site στον κοσμο δεν σε αφήνει ν αγραψεις (αν δεν θελει να εχει τρυπα) δυναμικο κωδικα οπως η php μεσα σε τετοια textboxes-σχολια!!!!

    ειναι σαν να προσπαθησεις εδω να γραψεις στα σχολια του DNZ asp.net κωδικα και να περημενεις το site αυτο να το διαβασει και να το Εκτελέση σαν κώδικα στον σερβερ! NO WAY!
    δεν δουλευει ετσι.


    τα καλα νεα?
    -γενικα αυτο που θες μπορει να γινει αλλα οχι ΕΚΕΙ που το θες!
    θα πρεπει να βρεις ενα αλλο σημειο πανω στην σελιδα που σε βολευει και απλα να προσθεσεις στον παραπανω κωδικα την επιπλεον λειτουργεια που θελεις!
    αυτο βεβαια θελει λιγο ψαξιμο που ειναι τι, ποια μεταβλητη ειναι αυτο που θες αλλα μολις το βρεις δεν ειναι παραπανω απο 15λεπτα με τις δοκιμες ;-)
    αλλα οχι εκει μεσα που το εχεις τωρα αν ειναι πεδιο κειμενου οπως φανταζομαι. αυτο ξεχνατο.


    ελπιζω να εχω πεσει μεσα στο πως εκανες οτι εκανες ως τωρα και αν ναι, τοτε αυτο που λεω + και - ειναι και το πως πιστευω οτι εχει η κατασταση τωρα.

    This Business Is Binary. You are a 1 or a 0. Alive or Dead.-
  •  01-07-2011, 13:35 66453 σε απάντηση της 66451

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    Johny έχεις δίκιο. Έτσι είναι τα πράγματα. Όσον αφορά τα καλά νέα θα ήθελα να σου πω ότι δεν έχω ελπίδες να βρω κάτι καθώς δεν ξέρω από κώδικα. Αν ήταν κάτι σε εκείνο το σημείο που βάζω το text κάπως θα την έκανα τη δουλειά. Αν μπορείς και δε βαριέσαι κοίτα το αλλιώς δεν πειράζει τι να κάνουμε...


    Δημήτρης
    ΜCP, MCTS, A+, NET+
  •  01-07-2011, 16:38 66455 σε απάντηση της 66453

    Απ: ΒΟΗΘΕΙΑ ΓΙΑ ESHOP

    θα δω πως θα ειναι το 2μερο και αναλογα, παντος ο τροπος που λεω να γινει ειναι πολυ καλητρος και θα ειναι αυτοματος εσυ δεν θα γραφεις τιποτα πλεον σε textboxesWink
    This Business Is Binary. You are a 1 or a 0. Alive or Dead.-
Σελίδα 1 από 2 (16 εγγραφές)   1 2 >
Προβολή Τροφοδοσίας RSS με μορφή XML
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems